<template>
  <el-config-provider
    :locale="locale"
    :size="siteThemeStore.elementSize"
    :zIndex="siteThemeStore.elementzIndex"
  >
    <router-view></router-view>
  </el-config-provider>
</template>
<script setup>
import { ref, onMounted, watch, computed } from "vue";
import { useSiteThemeStore } from "@/store/siteTheme";

import { useI18n } from "vue-i18n";
const i18n = useI18n();
import config from "@/config";

const siteThemeStore = useSiteThemeStore();

const colorPrimary = siteThemeStore.colorPrimary;
const menuHeaderColor = siteThemeStore.menuHeaderColor;
//动态添加该页面meta viewport 手机适配
// if (document.querySelector("meta[name='viewport']")) {
//   document.querySelector("meta[name='viewport']")["content"] =
//     "width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no";
// }

onMounted(() => {
  siteThemeStore.setColorPrimary(colorPrimary);
  if (siteThemeStore.siteTheme === "dark") {
    document.documentElement.classList.add("dark");
  } else {
    document.documentElement.classList.remove("dark");
    siteThemeStore.setMenuHeaderColor(menuHeaderColor);
  }

  // 动态添加或修改 meta viewport 标签
  let viewportMeta = document.querySelector('meta[name="viewport"]');

  viewportMeta.setAttribute(
    "content",
    "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
  );
});

const locale = computed(() => {
  return i18n.messages.value[i18n.locale.value]
    ? i18n.messages.value[i18n.locale.value].el
    : i18n.messages.value[config.LANG].el;
});
//此内容未经授权不能删除
console.info(
  `%cDjango-Vue-Lyadmin %cVer${config.APP_VER} %chttps://doc.lybbn.cn/`,
  "color:#409EFF;font-size: 22px;font-weight:bolder",
  "color:#999;font-size: 12px",
  "color:#333"
);
</script>

<style lang="scss">
#app {
  /*font-family: Avenir, Helvetica, Arial, sans-serif;*/
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /*text-align: center;*/
  /*color: #2c3e50;*/
  height: 100%;
}
/*页面最大化*/
.lyadmin.lymain-maximize {
  .lymain-maximize-exit {
    display: block;
  }
  .myeltas2,
  .lyadmin-header,
  .lyadmin-side {
    display: none;
  }
}
.lymain-maximize-exit {
  display: none;
  position: fixed;
  z-index: 3000;
  top: -20px;
  left: 50%;
  margin-left: -20px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
}
.lymain-maximize-exit i {
  font-size: 14px;
  margin-top: 22px;
  color: #fff;
}
.lymain-maximize-exit:hover {
  background: rgba(0, 0, 0, 0.4);
}
.el-header {
  padding-left: 0;
  padding-right: 0;
}
// 移动端样式覆盖
@media (max-width: 992px) {
  .index-header {
    padding: 0px;
    width: 100%;
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
    z-index: 2000;
  }
  .el-form-item {
    display: block;
  }
  .el-form-item__label {
    display: block;
    text-align: left;
    padding: 0 0 10px;
  }
  .el-dialog {
    width: 90% !important;
  }
  .el-dialog.is-fullscreen {
    width: 100% !important;
  }
  .el-drawer.rtl {
    width: 90% !important;
  }
  .el-form-item__content {
    margin-left: 0px !important;
  }

  .lyPagination-page {
    .el-pagination__total,
    .el-pagination__jump,
    .el-pagination__sizes {
      display: none !important;
    }
  }
  .myeltas2 {
    display: none;
  }
}

@media (max-width: 768px) {
  .el-date-range-picker .el-picker-panel__body {
    min-width: 100%;
  }
  .el-date-range-picker__content {
    width: 100% !important;
  }
  .el-date-range-picker {
    width: 100% !important;
  }
  .el-date-range-picker__content {
    margin: 0px;
    padding: 5px;
  }
  .el-date-range-picker__content.is-left {
    padding-bottom: 0px;
  }
  .el-date-range-picker__content.is-right {
    padding-top: 0px;
  }
  .el-date-table th {
    padding: 0px;
  }
  .el-date-table td {
    padding: 0px;
  }
}

// .ly-dialog {
//   // max-height: 80%;
//   overflow-y: auto;
// }
// .el-dialog{
//   max-height: 80% !important;
// }
// .el-dialog.is-fullscreen{
//   max-height: 100% !important;
// }

.ly-dialog {
  .el-form {
    max-height: 73vh !important;
    overflow-y: auto;
    overflow-x: hidden;
  }
}
</style>
<style>
.top_some {
  display: flex;
  align-items: center;
  font-size: 20px;
}
.icons {
  padding: 0 10px 0 0;
}
.boxs-bov {
  padding: 0 10px;
  box-sizing: border-box;
}
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  /* display: table; */
  /* content: ""; */
}
.clearfix:after {
  clear: both;
}
.clearfix {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  padding-top: 10px;
}
.box-card {
  width: 100%;
  margin-top: 20px;
}
.text_1 {
  width: 80px;
}
.text_item {
  line-height: 30px;
  font-size: 16px;
}
.clearfix {
  font-size: 14px;
}

/* 管理页面底部 */
.boxs_bov_buttons {
  display: flex;
  margin-top: 5px;
}
.multiple_choice {
  display: flex;
  justify-content: space-between;

  box-sizing: border-box;
}
.multiple_choice {
  background-color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  margin-top: 10px;
}
</style>


  